Constructing URLs to your server

Now that you have an http server, you'll want to reference it in your HTML documents and with your favorite Web browser.

Before you do anything, you should read this URL primer to familiarize yourself with URLs. You will want to pay attention to the section referring to HTTP URLs.


Definition

HTTP URLs have the basic form:

http://servername:port/path

servername

Your server's full hostname. It can be the server's real name or a DNS alias.

port

This is the port which your server is listening on. Specifying it in the URL is optional. If omitted, it is assumed to be 80.

path

This is the path to the document. This is not the absolute pathname of the document on your machine.

The server translates path as follows:

  1. It looks for any defined Alias virtual names at the beginning of path. If it finds one, it replaces the virtual name with the real name and processes the request.

  2. It inserts DocumentRoot at the beginning of path and processes the request.


Setting up your Home Page

Some HTTP servers let you explicitly set up your home page (i.e. the page returned by the URL http://yourserver/ ).

To do this using NCSA httpd, create a DirectoryIndex file in the DocumentRoot directory.


Examples

My Resource Configuration file contains the following directives (among others):

DocumentRoot /www/htdocs
DirectoryIndex index.htm
Alias /zftp z:/ftp/pub
An HTML document references http://www.foo.bar/policy/Overview.htm. The server finds no Alias virtual names in path, so it returns the file /www/htdocs/policy/Overview.htm.

Someone references the server's home page as http://www.foo.bar/. The server finds no virtual names, so it returns /www/htdocs/index.htm. If there is no index.htm, the server will generate a directory index on the fly. You really should have a home page on your server, or it will look like a gopher or FTP server when seen by a browser.

Another HTML document references http://www.foo.bar/zftp/README.txt. The server finds the Alias /zftp at the beginning of path, and returns the file z:/ftp/pub/README.txt.

Return to administration overview


Robert B. Denny <rdenny@netcom.com>